package com.qiyuexinxi.chat.feign;

import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.Pattern;
import java.util.Map;

/**
 * @author yangxingyu
 * @date 2020/2/27
 * @description
 */
@FeignClient(value = "${message.ip}",url = "${message.ip}",fallbackFactory = SendMessageBack.class)
@Component
public interface SendMessageFeign {

    /**
     * 发送短信
     * @return
     */
    @GetMapping(value = "${message.url}",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String,Object> sendPhoneCodeGet(@RequestParam("uid")Integer uid,@RequestParam("password")String password,@RequestParam("mobile")String mobile,@RequestParam("msg")String msg);

    /**
     * 发送短信
     * @param params
     * @return
     */
    @RequestMapping(value = "${message.url}", method = RequestMethod.POST)
    Map<String,Object> sendPhoneCode(@RequestBody Map<String,Object> params );

}
